package com.kws.tool.controller;

import cn.hutool.json.JSONUtil;
import com.kws.common.config.dao.Express100Info;
import com.kws.common.config.dao.rq.QueryExpress100Rq;
import com.kws.common.core.domain.R;
import com.kws.tool.util.ExpressDeliveryUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <b>ExpressDeliveryController</b>
 *
 * @description: ExpressDeliveryController <br>
 * @date: 2024/11/11 09:18 <br>
 * @author: lhm <br>
 * @version: 1.0 <br>
 */

@Api(tags = "快递物流查询")
@RestController
public class ExpressDeliveryController {
    private static final Logger logger = LoggerFactory.getLogger(ExpressDeliveryController.class);

    @Autowired
    private ExpressDeliveryUtil expressDeliveryUtil;

    @ApiOperation("查询物流消息")
    @PostMapping("/query/expressDelivery/page")
    public R<Express100Info> queryExpressDeliveryPage(@RequestBody QueryExpress100Rq rq){
        logger.info("查询订单物流消息查询入参：{}"+ JSONUtil.parse(rq));
        Express100Info express100Info = expressDeliveryUtil.queryExpressDelivery(rq);
        logger.info("查询订单物流信息返回结果:{}"+JSONUtil.parse(express100Info));
        return R.ok(express100Info);
    }
}
